
var Test = {

	customer : {
		source: function( request, response ) {
			$.ajax({
				url: 'contact.php?do=Customer.ajax_code',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.code + " [" + item.name + ", " + item.emp_t + "]",
							value: item.id + ":" + item.code
						}
					}));
				}
			});
		},
		
		minLength: 1
	},
	
	customer_code : {
		source: function( request, response ) {
			$.ajax({
				url: 'contact.php?do=Customer.ajax_code',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.code + " [" + item.name + ", " + item.emp_t + "]",
							value: item.code
						}
					}));
				}
			});
		},
		
		minLength: 1
	},
	
	customer_my : {
		source: function( request, response ) {
			$.ajax({
				url: 'contact.php?do=CustomerMy.ajax_my',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.code + " [" + item.name + ", " + item.emp_t + "]",
							value: item.id + ":" + item.code
						}
					}));
				}
			});
		},
		
		minLength: 1
	},
	
	customer_my_code : {
		source: function( request, response ) {
			$.ajax({
				url: 'contact.php?do=CustomerMy.ajax_my',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.code + " [" + item.name + ", " + item.emp_t + "]",
							value: item.code
						}
					}));
				}
			});
		},
		
		minLength: 1
	},
	
	quote : {
		source: function( request, response ) {
			$.ajax({
				url: 'customer.php?do=Quote.ajax_code',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.code + " [" + item.applicant_t + ", " + item.status_t + "]",
							value: item.id + ":" + item.code
						}
					}));
				}
			});
		},
		
		minLength: 1
	},
	
	quote_code : {
		source: function( request, response ) {
			$.ajax({
				url: 'customer.php?do=Quote.ajax_code',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.code + " [" + item.applicant_t + ", " + item.status_t + "]",
							value: item.code
						}
					}));
				}
			});
		},
		
		minLength: 1
	},
	
	supplier : {
		source: function( request, response ) {
			$.ajax({
				url: 'contact.php?do=Supplier.ajax_zjm',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.name + " [" + item.zjm + ", " + item.category + "]",
							value: item.id + ":" + item.name
						}
					}));
				}
			});
		},
		
		minLength: 1
	},
	
	supplier_name : {
		source: function( request, response ) {
			$.ajax({
				url: 'contact.php?do=Supplier.ajax_zjm',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.name + " [" + item.zjm + ", " + item.category + "]",
							value: item.name
						}
					}));
				}
			});
		},
		
		minLength: 1
	},
	
	potential : {
		source: function( request, response ) {
			$.ajax({
				url: 'customer.php?do=PotentialMy.ajax_zjm',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.name + " [" + item.zjm + ", " + item.category + "]",
							value: item.id + ":" + item.name
						}
					}));
				}
			});
		},
		
		minLength: 1
	},
	
	potential_name : {
		source: function( request, response ) {
			$.ajax({
				url: 'customer.php?do=PotentialMy.ajax_zjm',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.name + " [" + item.zjm + ", " + item.category + "]",
							value: item.name
						}
					}));
				}
			});
		},
		
		minLength: 1
	},
	
	dept : {
		source: function( request, response ) {
			$.ajax({
				url: 'info.php?do=Dept.ajax_code',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.name + " [" + item.code + "]",
							value: item.code
						}
					}));
				}
			});
		},
		
		minLength: 1
	},
	
	emp : {
		source: function( request, response ) {
			$.ajax({
				url: 'emp.php?do=Emp.ajax_zjm',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 30,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.name + " [" + item.zjm + ", " + item.dept_t + "]",
							value: item.id + ":" + item.name
						}
					}));
				}
			});
		},
		
		minLength: 1
	},
	
	emp_name : {
		source: function( request, response ) {
			$.ajax({
				url: 'emp.php?do=Emp.ajax_zjm',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.name + " [" + item.zjm + ", " + item.dept_t + "]",
							value: item.name
						}
					}));
				}
			});
		},
		
		minLength: 1
	},
	
	mold : {
		source: function( request, response ) {
			$.ajax({
				url: 'mold.php?do=Mold.ajax_code',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.code + " [" + item.engineer_t + ", " + item.status_t + "]",
							value: item.id + ":" + item.code
						}
					}));
				}
			});
		},
		
		minLength: 1
	},
	
	mold_code : {
		source: function( request, response ) {
			$.ajax({
				url: 'mold.php?do=Mold.ajax_code',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.code + " [" + item.engineer_t + ", " + item.status_t + "]",
							value: item.code
						}
					}));
				}
			});
		},
		
		minLength: 1
	},
	
	mold_code_my : {
		source: function( request, response ) {
			$.ajax({
				url: 'mold.php?do=Mold.ajax_my',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.code + " [" + item.engineer_t + ", " + item.status_t + "]",
							value: item.code
						}
					}));
				}
			});
		},
		
		minLength: 1
	},
	
	project : {
		source: function( request, response ) {
			$.ajax({
				url: 'mold.php?do=Mold.ajax_project',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.project,
							value: item.project
						}
					}));
				}
			});
		},
		
		minLength: 1
	},
	
	car : {
		source: function( request, response ) {
			$.ajax({
				url: 'car.php?do=Car.ajax_code',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.id + " [" + item.name + ", " + item.emp_t + "]",
							value: item.id + ":" + item.name
						}
					}));
				}
			});
		},
		
		minLength: 1
	},
	
	car_code : {
		source: function( request, response ) {
			$.ajax({
				url: 'car.php?do=Car.ajax_code',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.code + " [" + item.name + ", " + item.emp_t + "]",
							value: item.code
						}
					}));
				}
			});
		},
		
		minLength: 1
	},
	
	material : {
		source: function( request, response ) {
			$.ajax({
				url: 'material.php?do=Material.ajax_code',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: "[" + item.name + ", " + item.code + ', ' + item.category + ", " + item.subclass + "]",
							value: item.id + ":" + item.name + "+" + item.standard
						}
					}));
				}
			});
		},
		
		minLength: 1
	},
	
	machine : {
		source: function( request, response ) {
			$.ajax({
				url: 'material.php?do=Material.ajax_code',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.id + " [" + item.code + ", " + item.name + ", " + item.emp_t + "]",
							value: item.id + ":" + item.name
						}
					}));
				}
			});
		},
		
		minLength: 1
	}
};

var _date1_option = {
		numberOfMonths: 2,
		dateFormat: 'yy-mm-dd',
		showButtonPanel: true,

		beforeShow: function (i, e) {
                var z = jQuery(i).closest(".ui-dialog").css("z-index") + 4;
                e.dpDiv.css('z-index', z);
        }
	};

var _now_option = {
		numberOfMonths: 2,
		dateFormat: 'yy-mm-dd',
		showButtonPanel: true,
		minDate: new Date(),

		beforeShow: function (i, e) {
                var z = jQuery(i).closest(".ui-dialog").css("z-index") + 4;
                e.dpDiv.css('z-index', z);
        }
	};

var provinces = [
	{name: "广东" , zjm: "GD" },
	{name: "江西" , zjm: "JX" },
	{name: "湖南" , zjm: "HN" },

	{name: "河北" , zjm: "HB" },
	{name: "浙江" , zjm: "ZJ" },
	{name: "辽宁" , zjm: "LN" },
	{name: "湖北" , zjm: "HB" },
	{name: "江苏" , zjm: "JS" },
	{name: "内蒙古" , zjm: "NMG" },
	{name: "黑龙江" , zjm: "HLJ" },
	
	{name: "山西" , zjm: "SX" },
	{name: "甘肃" , zjm: "GS" },
	{name: "山东" , zjm: "SD" },	
	{name: "福建" , zjm: "FJ" },
	
	{name: "四川" , zjm: "SC" },
	
	{name: "河南" , zjm: "HN" },
	{name: "云南" , zjm: "YN" },
	{name: "安徽" , zjm: "AH" },
	{name: "吉林" , zjm: "JL" },
	{name: "广西" , zjm: "GX" },
	{name: "贵州" , zjm: "GZ" },
	{name: "陕西" , zjm: "SX" },
	{name: "青海" , zjm: "QH" },
	{name: "西藏" , zjm: "XC" },
	{name: "新疆" , zjm: "XJ" },
	{name: "海南" , zjm: "HN" },
	{name: "宁夏" , zjm: "NX" },
	{name: "北京" , zjm: "BJ" },
	{name: "上海" , zjm: "SH" },
	{name: "天津" , zjm: "TJ" },
	{name: "重庆" , zjm: "CQ" },
	{name: "香港" , zjm: "HK" },
	{name: "澳门" , zjm: "OM" },
	{name: "台湾" , zjm: "TW" }	
];
